chore(deps): update dependency linkify-it@<=5.0.0 to >=5.0.2 [security] - #917
Merged
Merged
Conversation
renovate
Bot
requested review from
a team,
DariaYeremina,
ValeryG,
adamdehaven,
jillztom and
kongponents-bot
as code owners
July 21, 2026 23:20
renovate
Bot
force-pushed
the
renovate/npm-linkify-it-=5.0.0-vulnerability
branch
10 times, most recently
from
July 27, 2026 15:16
d75f2b6 to
5be1713
Compare
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate
Bot
force-pushed
the
renovate/npm-linkify-it-=5.0.0-vulnerability
branch
from
July 27, 2026 15:29
5be1713 to
4613d0d
Compare
vaibhavrajsingh2001
approved these changes
Jul 27, 2026
Collaborator
|
🎉 This PR is included in version 1.109.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Collaborator
Install the preview package from this PR@kong/spec-renderer@pr-917 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
>=5.0.1→>=5.0.2linkify-it: Quadratic-complexity DoS via the
mailto:validator scan-loop on attacker textCVE-2026-59887 / GHSA-v245-v573-v5vm
More information
Details
Summary
linkify-it's schema-scan loop (.test()/.match(), the documented public API) invokes themailto:schema validator at every
mailto:occurrence in the input text. For each occurrence the validator doestext.slice(pos)(an O(n) copy) and runs an email regex whose local-part classsrc_email_namegreedilyscans the entire remaining tail (O(n)) before failing. With N
mailto:occurrences that isN × O(n) = O(n²). Because linkify-it runs on arbitrary user text (markdown-it feeds it whole documents
when
linkify:true), an unauthenticated attacker can block the single-threaded event loop for many secondswith a small input. No length bound (unlike an HTTP header).
Root cause —
index.mjs+lib/re.mjsThe
while ((m = re.exec(text)) !== null) { …testSchemaAt… }scan loop calls the validator at eachmailto:hit;src_email_namegreedily consumes the whole tail (all chars are in its class) then fails forlack of
@.http:/https:do NOT blow up — their validator requires the tail to start with//, failingin O(1) per hit.
Proof of Concept (confirmed, linkify-it 5.0.1, Node v24)
mailto:contiguousmailto:space-separatedhttp://contiguous×~4 per 2× input ⇒ O(n²); equal-byte controls stay flat ⇒ algorithmic, not a GC/allocation artifact.

Real-world via markdown-it 14.x (
{linkify:true}),md.render('mailto:'.repeat(n)): 219 KB ≈ ~5 s.Impact
Reachable on arbitrary user text via the documented
.test()/.match()API and through markdown-it'slinkifier — comment systems, chat, forums, wikis, note apps that render user markdown with linkify enabled.
A ~220 KB post hangs the event loop ~5 s; a few hundred KB → tens of seconds. Availability only.
Suggested remediation
Bound the email local-part per RFC 5321 (≤64) so per-hit work is O(1), and avoid the full-tail slice:
Affected / disclosure
All versions through 5.0.1 (latest); same code on
master. cve-mcp/OSV report no known vulnerability forlinkify-it. Distinct from markdown-it's own
*-run ReDoS (CVE-2026-2327, different package/path) and therecent markdown-it DoS. Reported privately; happy to test a patch against the PoC.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Release Notes
markdown-it/linkify-it (linkify-it@<=5.0.0)
v5.0.2Compare Source
mailto:links (restrict user name to 64 chars).Configuration
📅 Schedule: (in timezone America/New_York)
* * * * 1-5)🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.